package com.haixiaoke.saas.enterprise.task;

import com.haixiaoke.saas.contract.service.ILesseeContractService;
import com.haixiaoke.saas.contract.service.IProprietorContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 合同订单任务
 * @author panda
 * @Date 2024/6/14
 **/
@Component
public class ContractTask {

    @Autowired
    private ILesseeContractService lesseeContractService;
    @Autowired
    private IProprietorContractService proprietorContractService;

    /**
     * 每天凌晨0点10分执行租客合同逾期定时任务
     */
    @Scheduled(cron = "0 10 0 * * ?")
    public void lesseeContractOverdueTask() {
        lesseeContractService.lesseeContractOverdueTask();
    }

    /**
     * 每天凌晨0点10分执行业主合同逾期定时任务
     */
    @Scheduled(cron = "0 10 0 * * ?")
    public void proprietorContractOverdueTask() {
        proprietorContractService.proprietorContractOverdueTask();
    }
}
